curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
cat << EOF > /etc/docker/daemon.json
{
    "registry-mirrors":["https://reg-mirror.qiniu.com/"]
}
EOF
groupadd docker
usermod -aG docker litai
systemctl daemon-reload
systemctl restart docker
systemctl enable docker

mkdir -p ~/config/nodered
docker pull nodered/node-red
docker run -d -p 1880:1880 --privileged=true -v ~/config/nodered:/data --name mynodered -e TZ="Asia/Shanghai" nodered/node-red

mkdir -p ~/config/esphome
docker pull esphome/esphome
docker run -d --name="esphome" -e TZ=Asia/Shanghai --hostname='esphome' -v ~/config/esphome:/config -v /run/udev:/run/udev --privileged --restart unless-stopped --net=host esphome/esphome

mkdir -p ~/config/homeassistant
docker pull homeassistant/home-assistant
docker run -d --name homeassistant --privileged --restart=unless-stopped -e TZ=Asia/Shanghai -v ~/config/homeassistant:/config --network=host homeassistant/home-assistant

mkdir -p ~/config/aria2
docker pull superng6/aria2:webui-latest
docker run -d --name=aria2 -e PUID=1000 -e PGID=1000 -e TZ=Asia/Shanghai -e SECRET=wangaicc -e CACHE=512M -e PORT=6800 -e BTPORT=32516 -e WEBUI_PORT=8080 -e UT=true -e RUT=true -e FA=falloc -e QUIET=true -e SMD=true -p 6881:6881 -p 6881:6881/udp -p 6800:6800 -p 8080:8080 -v ~/config/aria2:/config -v ~/yp/sj/downloads:/downloads --restart=unless-stopped superng6/aria2:webui-latest

mkdir -p ~/config/qbittorrent
docker pull superng6/qbittorrent
docker run -d --name=qbittorrent -e WEBUIPORT=8080 -e PUID=1000 -e PGID=1000 -e TZ=Asia/Shanghai -p 6890:6881 -p 6890:6881/udp -p 8081:8080 -v ~/config/qbittorrent:/config -v ~/yp/sj/downloads:/downloads --restart=unless-stopped superng6/qbittorrent

docker volume create portainer_data
docker pull 6053537/portainer-ce
docker run -d -p 9000:9000 --name portainer --restart=unless-stopped -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data 6053537/portainer-ce

docker pull syncthing/syncthing
mkdir -p ~/config/syncthing
docker run -d --name=syncthing -p 8384:8384 -p 22000:22000 -p 21027:21027/udp -v /home/litai/yp/sj/downloads/photos/config:/var/syncthing/config -v /home/litai/yp/sj/downloads/photos:/var/syncthing --restart=unless-stopped syncthing/syncthing


docker pull xhofe/alist
mkdir -p ~/config/alist
docker run -d --restart=unless-stopped -v /home/litai/config/alist:/opt/alist/data -p 5244:5244 -e PUID=0 -e PGID=0 -e UMASK=022 --name="alist" xhofe/alist:latest
